const {merge}= require('webpack-merge');
const base = require('./webpack.base.js');
const TerserPlugin = require('terser-webpack-plugin');
//合并操作
module.exports=merge(base,{
    mode:"production",
    optimization:{
        minimizer:[
            new TerserPlugin()
        ],
        //可以把公共部分抽离出来
        splitChunks:{
            //可以把 第三方的库单独打包出去
            cacheGroups:{
                jq:{
                    name:'jquery',
                    test:/jquery|lodash/,
                    //分离方式
                    chunks:'initial'
                }
            }
        }
    }
})
